package com.iflytek.partitioner;

import org.apache.hadoop.io.LongWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;

import java.io.IOException;

public class BestPartitionMapper extends Mapper<LongWritable, Text,Text, Text> {

    Text outKey = new Text();

    @Override
    protected void map(LongWritable key, Text value, Context context) throws IOException, InterruptedException {
        String[] splits = value.toString().split(",");
        //以州作为输出的key
        outKey.set(splits[2]);
        context.write(outKey,value);
    }
}